<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>RaftLib: Pointer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RaftLib
   &#160;<span id="projectnumber">0.3a</span>
   </div>
   <div id="projectbrief">C++ Stream Processing Template Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_pointer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Pointer Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="pointer_8hpp_source.html">pointer.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae124185327ebd4938437141a6aec7ede"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_pointer.html#ae124185327ebd4938437141a6aec7ede">Pointer</a> (const std::size_t cap)</td></tr>
<tr class="separator:ae124185327ebd4938437141a6aec7ede"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f7fd9269cec287e5e78e026d20c2fca"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5f7fd9269cec287e5e78e026d20c2fca"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Pointer</b> (const std::size_t cap, const wrap_t wrap_set)</td></tr>
<tr class="separator:a5f7fd9269cec287e5e78e026d20c2fca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94c66784ca4f1f69be6feac9d8ecc7f2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_pointer.html#a94c66784ca4f1f69be6feac9d8ecc7f2">Pointer</a> (<a class="el" href="class_pointer.html">Pointer</a> *const other, const std::size_t new_cap)</td></tr>
<tr class="separator:a94c66784ca4f1f69be6feac9d8ecc7f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a27de62075753297225ad8217ba123307"><td class="memItemLeft" align="right" valign="top">static std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_pointer.html#a27de62075753297225ad8217ba123307">val</a> (<a class="el" href="class_pointer.html">Pointer</a> *const ptr)</td></tr>
<tr class="separator:a27de62075753297225ad8217ba123307"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc3754145e0b7a506ce0ad41732963c5"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_pointer.html#adc3754145e0b7a506ce0ad41732963c5">inc</a> (<a class="el" href="class_pointer.html">Pointer</a> *const ptr)</td></tr>
<tr class="separator:adc3754145e0b7a506ce0ad41732963c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a8b2320b26da7464aa73c3e14edbd97"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_pointer.html#a4a8b2320b26da7464aa73c3e14edbd97">incBy</a> (const std::size_t in, <a class="el" href="class_pointer.html">Pointer</a> *const ptr)</td></tr>
<tr class="separator:a4a8b2320b26da7464aa73c3e14edbd97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47f973d7d52da42d4089e576ed8584de"><td class="memItemLeft" align="right" valign="top">static std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_pointer.html#a47f973d7d52da42d4089e576ed8584de">wrapIndicator</a> (<a class="el" href="class_pointer.html">Pointer</a> *const ptr)</td></tr>
<tr class="separator:a47f973d7d52da42d4089e576ed8584de"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="pointer_8hpp_source.html">pointer.hpp</a> - </p><dl class="section author"><dt>Author</dt><dd>: Jonathan Beard </dd></dl>
<dl class="section version"><dt>Version</dt><dd>: Thu May 15 09:58:51 2014</dd></dl>
<p>Copyright 2014 Jonathan Beard</p>
<p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:</p>
<p><a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></p>
<p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ae124185327ebd4938437141a6aec7ede"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Pointer::Pointer </td>
          <td>(</td>
          <td class="paramtype">const std::size_t&#160;</td>
          <td class="paramname"><em>cap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="el" href="class_pointer.html">Pointer</a> - used to synchronize read and write pointers for the ring buffer. This class encapsulates wrapping. </p>

</div>
</div>
<a class="anchor" id="a94c66784ca4f1f69be6feac9d8ecc7f2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Pointer::Pointer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_pointer.html">Pointer</a> *const&#160;</td>
          <td class="paramname"><em>other</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::size_t&#160;</td>
          <td class="paramname"><em>new_cap</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="el" href="class_pointer.html">Pointer</a> - used to snchronize read and write poitners for the ring buffer, this constructer is a copy constructor that copies an old <a class="el" href="class_pointer.html">Pointer</a> object and sets a new max_capacity </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">other,const</td><td><a class="el" href="class_pointer.html">Pointer</a>&amp;, the other pointer to be cpied </td></tr>
    <tr><td class="paramname">new_cap,the</td><td>new max cap </td></tr>
  </table>
  </dd>
</dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><!-- SVG 0 -->
</div>
</div>
</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="adc3754145e0b7a506ce0ad41732963c5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Pointer::inc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_pointer.html">Pointer</a> *const&#160;</td>
          <td class="paramname"><em>ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>inc - increments the pointer, takes care of wrapping the pointers as well so you don't run off the page </p><dl class="section return"><dt>Returns</dt><dd>std::size_t, current value of pointer after increment </dd></dl>

</div>
</div>
<a class="anchor" id="a4a8b2320b26da7464aa73c3e14edbd97"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Pointer::incBy </td>
          <td>(</td>
          <td class="paramtype">const std::size_t&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_pointer.html">Pointer</a> *const&#160;</td>
          <td class="paramname"><em>ptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>incBy - increments the current pointer poisition by 'in' increments. To be used for range insertion and removal </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">in</td><td>- const std::size_t </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>std::size_t, current increment after adding 'in' </dd></dl>

</div>
</div>
<a class="anchor" id="a27de62075753297225ad8217ba123307"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t Pointer::val </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_pointer.html">Pointer</a> *const&#160;</td>
          <td class="paramname"><em>ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>val - returns the current value of val. Internally the function checks to ensure that any writes to the pointer have fully completed so that the value returned is ensured to be the correct one. This is important as it means the producer will only see a "conservative" estimate of how many items can be written and the consumer will only see a "conservative" estimate of how many items can be read. </p><dl class="section return"><dt>Returns</dt><dd>std::size_t, current 'true' value of the pointer </dd></dl>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><!-- SVG 1 -->
</div>
</div>
</p>

</div>
</div>
<a class="anchor" id="a47f973d7d52da42d4089e576ed8584de"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t Pointer::wrapIndicator </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_pointer.html">Pointer</a> *const&#160;</td>
          <td class="paramname"><em>ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>wrapIndiciator - returns the current wrap position, the read should never be ahead of the write, and at best they should be equal. This is used when determining to return max_cap or zero for the current queue size. </p><dl class="section return"><dt>Returns</dt><dd>std::size_t </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="pointer_8hpp_source.html">pointer.hpp</a></li>
<li>pointer.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Oct 12 2015 12:16:50 for RaftLib by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
